3.1.57 \(\int (a+b \tan (e+f x))^3 (c+d \tan (e+f x))^2 (A+B \tan (e+f x)+C \tan ^2(e+f x)) \, dx\) [57]

Optimal. Leaf size=661 \[ -\left (\left (a^3 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-3 a b^2 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )+3 a^2 b \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )-b^3 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) x\right )+\frac {\left (3 a^2 b \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-b^3 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-a^3 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )+3 a b^2 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) \log (\cos (e+f x))}{f}+\frac {d \left (3 a^2 b (A c-c C-B d)-b^3 (A c-c C-B d)+a^3 (B c+(A-C) d)-3 a b^2 (B c+(A-C) d)\right ) \tan (e+f x)}{f}+\frac {\left (a^3 B-3 a b^2 B+3 a^2 b (A-C)-b^3 (A-C)\right ) (c+d \tan (e+f x))^2}{2 f}+\frac {\left (4 a^3 C d^3-3 a^2 b d^2 (3 c C-16 B d)+3 a b^2 d \left (2 c^2 C-5 B c d+20 (A-C) d^2\right )-b^3 \left (c^3 C-2 B c^2 d+5 c (A-C) d^2+20 B d^3\right )\right ) (c+d \tan (e+f x))^3}{60 d^4 f}+\frac {b \left (5 b (A b+a B-b C) d^2+(b c-a d) (b c C-2 b B d-a C d)\right ) \tan (e+f x) (c+d \tan (e+f x))^3}{20 d^3 f}-\frac {(b c C-2 b B d-a C d) (a+b \tan (e+f x))^2 (c+d \tan (e+f x))^3}{10 d^2 f}+\frac {C (a+b \tan (e+f x))^3 (c+d \tan (e+f x))^3}{6 d f} \]

[Out]

-(a^3*(c^2*C+2*B*c*d-C*d^2-A*(c^2-d^2))-3*a*b^2*(c^2*C+2*B*c*d-C*d^2-A*(c^2-d^2))+3*a^2*b*(2*c*(A-C)*d+B*(c^2-
d^2))-b^3*(2*c*(A-C)*d+B*(c^2-d^2)))*x+(3*a^2*b*(c^2*C+2*B*c*d-C*d^2-A*(c^2-d^2))-b^3*(c^2*C+2*B*c*d-C*d^2-A*(
c^2-d^2))-a^3*(2*c*(A-C)*d+B*(c^2-d^2))+3*a*b^2*(2*c*(A-C)*d+B*(c^2-d^2)))*ln(cos(f*x+e))/f+d*(3*a^2*b*(A*c-B*
d-C*c)-b^3*(A*c-B*d-C*c)+a^3*(B*c+(A-C)*d)-3*a*b^2*(B*c+(A-C)*d))*tan(f*x+e)/f+1/2*(a^3*B-3*a*b^2*B+3*a^2*b*(A
-C)-b^3*(A-C))*(c+d*tan(f*x+e))^2/f+1/60*(4*a^3*C*d^3-3*a^2*b*d^2*(-16*B*d+3*C*c)+3*a*b^2*d*(2*c^2*C-5*B*c*d+2
0*(A-C)*d^2)-b^3*(c^3*C-2*B*c^2*d+5*c*(A-C)*d^2+20*B*d^3))*(c+d*tan(f*x+e))^3/d^4/f+1/20*b*(5*b*(A*b+B*a-C*b)*
d^2+(-a*d+b*c)*(-2*B*b*d-C*a*d+C*b*c))*tan(f*x+e)*(c+d*tan(f*x+e))^3/d^3/f-1/10*(-2*B*b*d-C*a*d+C*b*c)*(a+b*ta
n(f*x+e))^2*(c+d*tan(f*x+e))^3/d^2/f+1/6*C*(a+b*tan(f*x+e))^3*(c+d*tan(f*x+e))^3/d/f

________________________________________________________________________________________

Rubi [A]
time = 1.43, antiderivative size = 661, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, integrand size = 45, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {3728, 3718, 3711, 3609, 3606, 3556} \begin {gather*} \frac {\log (\cos (e+f x)) \left (-\left (a^3 \left (2 c d (A-C)+B \left (c^2-d^2\right )\right )\right )+3 a^2 b \left (-A \left (c^2-d^2\right )+2 B c d+c^2 C-C d^2\right )+3 a b^2 \left (2 c d (A-C)+B \left (c^2-d^2\right )\right )-b^3 \left (-A \left (c^2-d^2\right )+2 B c d+c^2 C-C d^2\right )\right )}{f}-x \left (a^3 \left (-A \left (c^2-d^2\right )+2 B c d+c^2 C-C d^2\right )+3 a^2 b \left (2 c d (A-C)+B \left (c^2-d^2\right )\right )-3 a b^2 \left (-A \left (c^2-d^2\right )+2 B c d+c^2 C-C d^2\right )-b^3 \left (2 c d (A-C)+B \left (c^2-d^2\right )\right )\right )+\frac {(c+d \tan (e+f x))^3 \left (4 a^3 C d^3-3 a^2 b d^2 (3 c C-16 B d)+3 a b^2 d \left (20 d^2 (A-C)-5 B c d+2 c^2 C\right )-\left (b^3 \left (5 c d^2 (A-C)-2 B c^2 d+20 B d^3+c^3 C\right )\right )\right )}{60 d^4 f}+\frac {\left (a^3 B+3 a^2 b (A-C)-3 a b^2 B-b^3 (A-C)\right ) (c+d \tan (e+f x))^2}{2 f}+\frac {d \tan (e+f x) \left (a^3 (d (A-C)+B c)+3 a^2 b (A c-B d-c C)-3 a b^2 (d (A-C)+B c)-b^3 (A c-B d-c C)\right )}{f}+\frac {b \tan (e+f x) (c+d \tan (e+f x))^3 \left (5 b d^2 (a B+A b-b C)+(b c-a d) (-a C d-2 b B d+b c C)\right )}{20 d^3 f}-\frac {(-a C d-2 b B d+b c C) (a+b \tan (e+f x))^2 (c+d \tan (e+f x))^3}{10 d^2 f}+\frac {C (a+b \tan (e+f x))^3 (c+d \tan (e+f x))^3}{6 d f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*Tan[e + f*x])^3*(c + d*Tan[e + f*x])^2*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2),x]

[Out]

-((a^3*(c^2*C + 2*B*c*d - C*d^2 - A*(c^2 - d^2)) - 3*a*b^2*(c^2*C + 2*B*c*d - C*d^2 - A*(c^2 - d^2)) + 3*a^2*b
*(2*c*(A - C)*d + B*(c^2 - d^2)) - b^3*(2*c*(A - C)*d + B*(c^2 - d^2)))*x) + ((3*a^2*b*(c^2*C + 2*B*c*d - C*d^
2 - A*(c^2 - d^2)) - b^3*(c^2*C + 2*B*c*d - C*d^2 - A*(c^2 - d^2)) - a^3*(2*c*(A - C)*d + B*(c^2 - d^2)) + 3*a
*b^2*(2*c*(A - C)*d + B*(c^2 - d^2)))*Log[Cos[e + f*x]])/f + (d*(3*a^2*b*(A*c - c*C - B*d) - b^3*(A*c - c*C -
B*d) + a^3*(B*c + (A - C)*d) - 3*a*b^2*(B*c + (A - C)*d))*Tan[e + f*x])/f + ((a^3*B - 3*a*b^2*B + 3*a^2*b*(A -
 C) - b^3*(A - C))*(c + d*Tan[e + f*x])^2)/(2*f) + ((4*a^3*C*d^3 - 3*a^2*b*d^2*(3*c*C - 16*B*d) + 3*a*b^2*d*(2
*c^2*C - 5*B*c*d + 20*(A - C)*d^2) - b^3*(c^3*C - 2*B*c^2*d + 5*c*(A - C)*d^2 + 20*B*d^3))*(c + d*Tan[e + f*x]
)^3)/(60*d^4*f) + (b*(5*b*(A*b + a*B - b*C)*d^2 + (b*c - a*d)*(b*c*C - 2*b*B*d - a*C*d))*Tan[e + f*x]*(c + d*T
an[e + f*x])^3)/(20*d^3*f) - ((b*c*C - 2*b*B*d - a*C*d)*(a + b*Tan[e + f*x])^2*(c + d*Tan[e + f*x])^3)/(10*d^2
*f) + (C*(a + b*Tan[e + f*x])^3*(c + d*Tan[e + f*x])^3)/(6*d*f)

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3606

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[b*d*(Tan[e + f*x]/f), x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 3609

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[d*
((a + b*Tan[e + f*x])^m/(f*m)), x] + Int[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && GtQ[m, 0]

Rule 3711

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (
f_.)*(x_)]^2), x_Symbol] :> Simp[C*((a + b*Tan[e + f*x])^(m + 1)/(b*f*(m + 1))), x] + Int[(a + b*Tan[e + f*x])
^m*Simp[A - C + B*Tan[e + f*x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && NeQ[A*b^2 - a*b*B + a^2*C, 0]
&&  !LeQ[m, -1]

Rule 3718

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (B_.)*tan[(e
_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[b*C*Tan[e + f*x]*((c + d*Tan[e + f*x])
^(n + 1)/(d*f*(n + 2))), x] - Dist[1/(d*(n + 2)), Int[(c + d*Tan[e + f*x])^n*Simp[b*c*C - a*A*d*(n + 2) - (A*b
 + a*B - b*C)*d*(n + 2)*Tan[e + f*x] - (a*C*d*(n + 2) - b*(c*C - B*d*(n + 2)))*Tan[e + f*x]^2, x], x], x] /; F
reeQ[{a, b, c, d, e, f, A, B, C, n}, x] && NeQ[b*c - a*d, 0] && NeQ[c^2 + d^2, 0] &&  !LtQ[n, -1]

Rule 3728

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)*((A_.) + (B_.)*
tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[C*(a + b*Tan[e + f*x])^m*((c + d
*Tan[e + f*x])^(n + 1)/(d*f*(m + n + 1))), x] + Dist[1/(d*(m + n + 1)), Int[(a + b*Tan[e + f*x])^(m - 1)*(c +
d*Tan[e + f*x])^n*Simp[a*A*d*(m + n + 1) - C*(b*c*m + a*d*(n + 1)) + d*(A*b + a*B - b*C)*(m + n + 1)*Tan[e + f
*x] - (C*m*(b*c - a*d) - b*B*d*(m + n + 1))*Tan[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, n}
, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && GtQ[m, 0] &&  !(IGtQ[n, 0] && ( !Intege
rQ[m] || (EqQ[c, 0] && NeQ[a, 0])))

Rubi steps

\begin {align*} \int (a+b \tan (e+f x))^3 (c+d \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx &=\frac {C (a+b \tan (e+f x))^3 (c+d \tan (e+f x))^3}{6 d f}+\frac {\int (a+b \tan (e+f x))^2 (c+d \tan (e+f x))^2 \left (-3 (b c C-a (2 A-C) d)+6 (A b+a B-b C) d \tan (e+f x)-3 (b c C-2 b B d-a C d) \tan ^2(e+f x)\right ) \, dx}{6 d}\\ &=-\frac {(b c C-2 b B d-a C d) (a+b \tan (e+f x))^2 (c+d \tan (e+f x))^3}{10 d^2 f}+\frac {C (a+b \tan (e+f x))^3 (c+d \tan (e+f x))^3}{6 d f}+\frac {\int (a+b \tan (e+f x)) (c+d \tan (e+f x))^2 \left (6 \left (a^2 (5 A-4 C) d^2+b^2 c (c C-2 B d)-a b d (2 c C+3 B d)\right )+30 \left (a^2 B-b^2 B+2 a b (A-C)\right ) d^2 \tan (e+f x)+6 \left (5 b (A b+a B-b C) d^2+(b c-a d) (b c C-2 b B d-a C d)\right ) \tan ^2(e+f x)\right ) \, dx}{30 d^2}\\ &=\frac {b \left (5 b (A b+a B-b C) d^2+(b c-a d) (b c C-2 b B d-a C d)\right ) \tan (e+f x) (c+d \tan (e+f x))^3}{20 d^3 f}-\frac {(b c C-2 b B d-a C d) (a+b \tan (e+f x))^2 (c+d \tan (e+f x))^3}{10 d^2 f}+\frac {C (a+b \tan (e+f x))^3 (c+d \tan (e+f x))^3}{6 d f}-\frac {\int (c+d \tan (e+f x))^2 \left (-6 \left (4 a^3 (5 A-4 C) d^3+3 a b^2 c d (2 c C-5 B d)-3 a^2 b d^2 (3 c C+4 B d)-b^3 c \left (c^2 C-2 B c d+5 (A-C) d^2\right )\right )-120 \left (a^3 B-3 a b^2 B+3 a^2 b (A-C)-b^3 (A-C)\right ) d^3 \tan (e+f x)-6 \left (4 a^3 C d^3-3 a^2 b d^2 (3 c C-16 B d)+3 a b^2 d \left (2 c^2 C-5 B c d+20 (A-C) d^2\right )-b^3 \left (c^3 C-2 B c^2 d+5 c (A-C) d^2+20 B d^3\right )\right ) \tan ^2(e+f x)\right ) \, dx}{120 d^3}\\ &=\frac {\left (4 a^3 C d^3-3 a^2 b d^2 (3 c C-16 B d)+3 a b^2 d \left (2 c^2 C-5 B c d+20 (A-C) d^2\right )-b^3 \left (c^3 C-2 B c^2 d+5 c (A-C) d^2+20 B d^3\right )\right ) (c+d \tan (e+f x))^3}{60 d^4 f}+\frac {b \left (5 b (A b+a B-b C) d^2+(b c-a d) (b c C-2 b B d-a C d)\right ) \tan (e+f x) (c+d \tan (e+f x))^3}{20 d^3 f}-\frac {(b c C-2 b B d-a C d) (a+b \tan (e+f x))^2 (c+d \tan (e+f x))^3}{10 d^2 f}+\frac {C (a+b \tan (e+f x))^3 (c+d \tan (e+f x))^3}{6 d f}-\frac {\int (c+d \tan (e+f x))^2 \left (120 \left (3 a^2 b B-b^3 B-a^3 (A-C)+3 a b^2 (A-C)\right ) d^3-120 \left (a^3 B-3 a b^2 B+3 a^2 b (A-C)-b^3 (A-C)\right ) d^3 \tan (e+f x)\right ) \, dx}{120 d^3}\\ &=\frac {\left (a^3 B-3 a b^2 B+3 a^2 b (A-C)-b^3 (A-C)\right ) (c+d \tan (e+f x))^2}{2 f}+\frac {\left (4 a^3 C d^3-3 a^2 b d^2 (3 c C-16 B d)+3 a b^2 d \left (2 c^2 C-5 B c d+20 (A-C) d^2\right )-b^3 \left (c^3 C-2 B c^2 d+5 c (A-C) d^2+20 B d^3\right )\right ) (c+d \tan (e+f x))^3}{60 d^4 f}+\frac {b \left (5 b (A b+a B-b C) d^2+(b c-a d) (b c C-2 b B d-a C d)\right ) \tan (e+f x) (c+d \tan (e+f x))^3}{20 d^3 f}-\frac {(b c C-2 b B d-a C d) (a+b \tan (e+f x))^2 (c+d \tan (e+f x))^3}{10 d^2 f}+\frac {C (a+b \tan (e+f x))^3 (c+d \tan (e+f x))^3}{6 d f}-\frac {\int (c+d \tan (e+f x)) \left (-120 d^3 \left (a^3 (A c-c C-B d)-3 a b^2 (A c-c C-B d)-3 a^2 b (B c+(A-C) d)+b^3 (B c+(A-C) d)\right )-120 d^3 \left (3 a^2 b (A c-c C-B d)-b^3 (A c-c C-B d)+a^3 (B c+(A-C) d)-3 a b^2 (B c+(A-C) d)\right ) \tan (e+f x)\right ) \, dx}{120 d^3}\\ &=-\left (a^3 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-3 a b^2 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )+3 a^2 b \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )-b^3 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) x+\frac {d \left (3 a^2 b (A c-c C-B d)-b^3 (A c-c C-B d)+a^3 (B c+(A-C) d)-3 a b^2 (B c+(A-C) d)\right ) \tan (e+f x)}{f}+\frac {\left (a^3 B-3 a b^2 B+3 a^2 b (A-C)-b^3 (A-C)\right ) (c+d \tan (e+f x))^2}{2 f}+\frac {\left (4 a^3 C d^3-3 a^2 b d^2 (3 c C-16 B d)+3 a b^2 d \left (2 c^2 C-5 B c d+20 (A-C) d^2\right )-b^3 \left (c^3 C-2 B c^2 d+5 c (A-C) d^2+20 B d^3\right )\right ) (c+d \tan (e+f x))^3}{60 d^4 f}+\frac {b \left (5 b (A b+a B-b C) d^2+(b c-a d) (b c C-2 b B d-a C d)\right ) \tan (e+f x) (c+d \tan (e+f x))^3}{20 d^3 f}-\frac {(b c C-2 b B d-a C d) (a+b \tan (e+f x))^2 (c+d \tan (e+f x))^3}{10 d^2 f}+\frac {C (a+b \tan (e+f x))^3 (c+d \tan (e+f x))^3}{6 d f}-\left (3 a^2 b \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-b^3 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-a^3 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )+3 a b^2 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) \int \tan (e+f x) \, dx\\ &=-\left (a^3 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-3 a b^2 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )+3 a^2 b \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )-b^3 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) x+\frac {\left (3 a^2 b \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-b^3 \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )-a^3 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )+3 a b^2 \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right ) \log (\cos (e+f x))}{f}+\frac {d \left (3 a^2 b (A c-c C-B d)-b^3 (A c-c C-B d)+a^3 (B c+(A-C) d)-3 a b^2 (B c+(A-C) d)\right ) \tan (e+f x)}{f}+\frac {\left (a^3 B-3 a b^2 B+3 a^2 b (A-C)-b^3 (A-C)\right ) (c+d \tan (e+f x))^2}{2 f}+\frac {\left (4 a^3 C d^3-3 a^2 b d^2 (3 c C-16 B d)+3 a b^2 d \left (2 c^2 C-5 B c d+20 (A-C) d^2\right )-b^3 \left (c^3 C-2 B c^2 d+5 c (A-C) d^2+20 B d^3\right )\right ) (c+d \tan (e+f x))^3}{60 d^4 f}+\frac {b \left (5 b (A b+a B-b C) d^2+(b c-a d) (b c C-2 b B d-a C d)\right ) \tan (e+f x) (c+d \tan (e+f x))^3}{20 d^3 f}-\frac {(b c C-2 b B d-a C d) (a+b \tan (e+f x))^2 (c+d \tan (e+f x))^3}{10 d^2 f}+\frac {C (a+b \tan (e+f x))^3 (c+d \tan (e+f x))^3}{6 d f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 6.45, size = 573, normalized size = 0.87 \begin {gather*} \frac {C (a+b \tan (e+f x))^3 (c+d \tan (e+f x))^3}{6 d f}+\frac {-\frac {3 (b c C-2 b B d-a C d) (a+b \tan (e+f x))^2 (c+d \tan (e+f x))^3}{5 d f}+\frac {\frac {3 b \left (5 b (A b+a B-b C) d^2+(b c-a d) (b c C-2 b B d-a C d)\right ) \tan (e+f x) (c+d \tan (e+f x))^3}{2 d f}-\frac {\frac {\left (-24 a d \left (5 b (A b+a B-b C) d^2+(b c-a d) (b c C-2 b B d-a C d)\right )+b \left (-120 \left (a^2 B-b^2 B+2 a b (A-C)\right ) d^3+6 c \left (5 b (A b+a B-b C) d^2+(b c-a d) (b c C-2 b B d-a C d)\right )\right )\right ) (c+d \tan (e+f x))^3}{3 d f}-\frac {60 \left (d^2 \left (3 a^2 b (A c-c C+B d)-b^3 (A c-c C+B d)+a^3 (B c-(A-C) d)-3 a b^2 (B c-(A-C) d)\right ) \left (i (c+i d)^2 \log (i-\tan (e+f x))-i (c-i d)^2 \log (i+\tan (e+f x))-2 d^2 \tan (e+f x)\right )+\left (a^3 B-3 a b^2 B+3 a^2 b (A-C)-b^3 (A-C)\right ) d^2 \left ((i c-d)^3 \log (i-\tan (e+f x))-(i c+d)^3 \log (i+\tan (e+f x))+6 c d^2 \tan (e+f x)+d^3 \tan ^2(e+f x)\right )\right )}{f}}{4 d}}{5 d}}{6 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Tan[e + f*x])^3*(c + d*Tan[e + f*x])^2*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2),x]

[Out]

(C*(a + b*Tan[e + f*x])^3*(c + d*Tan[e + f*x])^3)/(6*d*f) + ((-3*(b*c*C - 2*b*B*d - a*C*d)*(a + b*Tan[e + f*x]
)^2*(c + d*Tan[e + f*x])^3)/(5*d*f) + ((3*b*(5*b*(A*b + a*B - b*C)*d^2 + (b*c - a*d)*(b*c*C - 2*b*B*d - a*C*d)
)*Tan[e + f*x]*(c + d*Tan[e + f*x])^3)/(2*d*f) - (((-24*a*d*(5*b*(A*b + a*B - b*C)*d^2 + (b*c - a*d)*(b*c*C -
2*b*B*d - a*C*d)) + b*(-120*(a^2*B - b^2*B + 2*a*b*(A - C))*d^3 + 6*c*(5*b*(A*b + a*B - b*C)*d^2 + (b*c - a*d)
*(b*c*C - 2*b*B*d - a*C*d))))*(c + d*Tan[e + f*x])^3)/(3*d*f) - (60*(d^2*(3*a^2*b*(A*c - c*C + B*d) - b^3*(A*c
 - c*C + B*d) + a^3*(B*c - (A - C)*d) - 3*a*b^2*(B*c - (A - C)*d))*(I*(c + I*d)^2*Log[I - Tan[e + f*x]] - I*(c
 - I*d)^2*Log[I + Tan[e + f*x]] - 2*d^2*Tan[e + f*x]) + (a^3*B - 3*a*b^2*B + 3*a^2*b*(A - C) - b^3*(A - C))*d^
2*((I*c - d)^3*Log[I - Tan[e + f*x]] - (I*c + d)^3*Log[I + Tan[e + f*x]] + 6*c*d^2*Tan[e + f*x] + d^3*Tan[e +
f*x]^2)))/f)/(4*d))/(5*d))/(6*d)

________________________________________________________________________________________

Maple [A]
time = 0.24, size = 1239, normalized size = 1.87

method result size
norman \(\left (A \,a^{3} c^{2}-A \,a^{3} d^{2}-6 A \,a^{2} b c d -3 A a \,b^{2} c^{2}+3 A a \,b^{2} d^{2}+2 A \,b^{3} c d -2 B \,a^{3} c d -3 B \,a^{2} b \,c^{2}+3 B \,a^{2} b \,d^{2}+6 B a \,b^{2} c d +B \,b^{3} c^{2}-B \,b^{3} d^{2}-C \,a^{3} c^{2}+C \,a^{3} d^{2}+6 C \,a^{2} b c d +3 C a \,b^{2} c^{2}-3 C a \,b^{2} d^{2}-2 C \,b^{3} c d \right ) x +\frac {\left (A \,a^{3} d^{2}+6 A \,a^{2} b c d +3 A a \,b^{2} c^{2}-3 A a \,b^{2} d^{2}-2 A \,b^{3} c d +2 B \,a^{3} c d +3 B \,a^{2} b \,c^{2}-3 B \,a^{2} b \,d^{2}-6 B a \,b^{2} c d -B \,b^{3} c^{2}+B \,b^{3} d^{2}+C \,a^{3} c^{2}-C \,a^{3} d^{2}-6 C \,a^{2} b c d -3 C a \,b^{2} c^{2}+3 C a \,b^{2} d^{2}+2 C \,b^{3} c d \right ) \tan \left (f x +e \right )}{f}+\frac {\left (3 A a \,b^{2} d^{2}+2 A \,b^{3} c d +3 B \,a^{2} b \,d^{2}+6 B a \,b^{2} c d +B \,b^{3} c^{2}-B \,b^{3} d^{2}+C \,a^{3} d^{2}+6 C \,a^{2} b c d +3 C a \,b^{2} c^{2}-3 C a \,b^{2} d^{2}-2 C \,b^{3} c d \right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3 f}+\frac {\left (3 A \,a^{2} b \,d^{2}+6 A a \,b^{2} c d +A \,b^{3} c^{2}-A \,b^{3} d^{2}+B \,a^{3} d^{2}+6 B \,a^{2} b c d +3 B a \,b^{2} c^{2}-3 B a \,b^{2} d^{2}-2 B \,b^{3} c d +2 C \,a^{3} c d +3 C \,a^{2} b \,c^{2}-3 C \,a^{2} b \,d^{2}-6 C a \,b^{2} c d -C \,b^{3} c^{2}+C \,b^{3} d^{2}\right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2 f}+\frac {b \left (A \,b^{2} d^{2}+3 B a b \,d^{2}+2 B \,b^{2} c d +3 a^{2} C \,d^{2}+6 C a b c d +C \,b^{2} c^{2}-C \,b^{2} d^{2}\right ) \left (\tan ^{4}\left (f x +e \right )\right )}{4 f}+\frac {C \,b^{3} d^{2} \left (\tan ^{6}\left (f x +e \right )\right )}{6 f}+\frac {b^{2} d \left (B b d +3 a C d +2 C b c \right ) \left (\tan ^{5}\left (f x +e \right )\right )}{5 f}+\frac {\left (2 A \,a^{3} c d +3 A \,a^{2} b \,c^{2}-3 A \,a^{2} b \,d^{2}-6 A a \,b^{2} c d -A \,b^{3} c^{2}+A \,b^{3} d^{2}+B \,a^{3} c^{2}-B \,a^{3} d^{2}-6 B \,a^{2} b c d -3 B a \,b^{2} c^{2}+3 B a \,b^{2} d^{2}+2 B \,b^{3} c d -2 C \,a^{3} c d -3 C \,a^{2} b \,c^{2}+3 C \,a^{2} b \,d^{2}+6 C a \,b^{2} c d +C \,b^{3} c^{2}-C \,b^{3} d^{2}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f}\) \(896\)
derivativedivides \(\text {Expression too large to display}\) \(1239\)
default \(\text {Expression too large to display}\) \(1239\)
risch \(\text {Expression too large to display}\) \(4231\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*tan(f*x+e))^3*(c+d*tan(f*x+e))^2*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x,method=_RETURNVERBOSE)

[Out]

1/f*(3*A*a*b^2*c*d*tan(f*x+e)^2+3*B*a^2*b*c*d*tan(f*x+e)^2-3*C*a*b^2*c*d*tan(f*x+e)^2+3/2*C*a*b^2*c*d*tan(f*x+
e)^4+2*B*a*b^2*c*d*tan(f*x+e)^3+2*C*a^2*b*c*d*tan(f*x+e)^3+6*A*a^2*b*c*d*tan(f*x+e)-6*B*a*b^2*c*d*tan(f*x+e)-6
*C*a^2*b*c*d*tan(f*x+e)+3*B*a^2*b*c^2*tan(f*x+e)-3*B*a^2*b*d^2*tan(f*x+e)-3*C*a*b^2*c^2*tan(f*x+e)+3*C*a*b^2*d
^2*tan(f*x+e)+2*C*b^3*c*d*tan(f*x+e)+1/2*(2*A*a^3*c*d+3*A*a^2*b*c^2-3*A*a^2*b*d^2-6*A*a*b^2*c*d-A*b^3*c^2+A*b^
3*d^2+B*a^3*c^2-B*a^3*d^2-6*B*a^2*b*c*d-3*B*a*b^2*c^2+3*B*a*b^2*d^2+2*B*b^3*c*d-2*C*a^3*c*d-3*C*a^2*b*c^2+3*C*
a^2*b*d^2+6*C*a*b^2*c*d+C*b^3*c^2-C*b^3*d^2)*ln(1+tan(f*x+e)^2)+(A*a^3*c^2-A*a^3*d^2-6*A*a^2*b*c*d-3*A*a*b^2*c
^2+3*A*a*b^2*d^2+2*A*b^3*c*d-2*B*a^3*c*d-3*B*a^2*b*c^2+3*B*a^2*b*d^2+6*B*a*b^2*c*d+B*b^3*c^2-B*b^3*d^2-C*a^3*c
^2+C*a^3*d^2+6*C*a^2*b*c*d+3*C*a*b^2*c^2-3*C*a*b^2*d^2-2*C*b^3*c*d)*arctan(tan(f*x+e))+1/4*A*b^3*d^2*tan(f*x+e
)^4+1/4*C*b^3*c^2*tan(f*x+e)^4-1/4*C*b^3*d^2*tan(f*x+e)^4+1/3*B*b^3*c^2*tan(f*x+e)^3-1/3*B*b^3*d^2*tan(f*x+e)^
3+1/3*C*a^3*d^2*tan(f*x+e)^3+1/2*A*b^3*c^2*tan(f*x+e)^2-1/2*A*b^3*d^2*tan(f*x+e)^2+1/2*B*a^3*d^2*tan(f*x+e)^2-
1/2*C*b^3*c^2*tan(f*x+e)^2+1/2*C*b^3*d^2*tan(f*x+e)^2+1/6*C*b^3*d^2*tan(f*x+e)^6+A*a^3*d^2*tan(f*x+e)-B*b^3*c^
2*tan(f*x+e)+B*b^3*d^2*tan(f*x+e)+C*a^3*c^2*tan(f*x+e)-C*a^3*d^2*tan(f*x+e)+1/5*B*b^3*d^2*tan(f*x+e)^5+C*a^3*c
*d*tan(f*x+e)^2+A*a*b^2*d^2*tan(f*x+e)^3+B*a^2*b*d^2*tan(f*x+e)^3+C*a*b^2*c^2*tan(f*x+e)^3+3/5*C*a*b^2*d^2*tan
(f*x+e)^5+2/5*C*b^3*c*d*tan(f*x+e)^5+3/4*B*a*b^2*d^2*tan(f*x+e)^4+1/2*B*b^3*c*d*tan(f*x+e)^4+3/4*C*a^2*b*d^2*t
an(f*x+e)^4+2/3*A*b^3*c*d*tan(f*x+e)^3-C*a*b^2*d^2*tan(f*x+e)^3-2/3*C*b^3*c*d*tan(f*x+e)^3+3/2*A*a^2*b*d^2*tan
(f*x+e)^2+3/2*B*a*b^2*c^2*tan(f*x+e)^2-3/2*B*a*b^2*d^2*tan(f*x+e)^2-B*b^3*c*d*tan(f*x+e)^2+3/2*C*a^2*b*c^2*tan
(f*x+e)^2-3/2*C*a^2*b*d^2*tan(f*x+e)^2+3*A*a*b^2*c^2*tan(f*x+e)-3*A*a*b^2*d^2*tan(f*x+e)-2*A*b^3*c*d*tan(f*x+e
)+2*B*a^3*c*d*tan(f*x+e))

________________________________________________________________________________________

Maxima [A]
time = 0.51, size = 699, normalized size = 1.06 \begin {gather*} \frac {10 \, C b^{3} d^{2} \tan \left (f x + e\right )^{6} + 12 \, {\left (2 \, C b^{3} c d + {\left (3 \, C a b^{2} + B b^{3}\right )} d^{2}\right )} \tan \left (f x + e\right )^{5} + 15 \, {\left (C b^{3} c^{2} + 2 \, {\left (3 \, C a b^{2} + B b^{3}\right )} c d + {\left (3 \, C a^{2} b + 3 \, B a b^{2} + {\left (A - C\right )} b^{3}\right )} d^{2}\right )} \tan \left (f x + e\right )^{4} + 20 \, {\left ({\left (3 \, C a b^{2} + B b^{3}\right )} c^{2} + 2 \, {\left (3 \, C a^{2} b + 3 \, B a b^{2} + {\left (A - C\right )} b^{3}\right )} c d + {\left (C a^{3} + 3 \, B a^{2} b + 3 \, {\left (A - C\right )} a b^{2} - B b^{3}\right )} d^{2}\right )} \tan \left (f x + e\right )^{3} + 30 \, {\left ({\left (3 \, C a^{2} b + 3 \, B a b^{2} + {\left (A - C\right )} b^{3}\right )} c^{2} + 2 \, {\left (C a^{3} + 3 \, B a^{2} b + 3 \, {\left (A - C\right )} a b^{2} - B b^{3}\right )} c d + {\left (B a^{3} + 3 \, {\left (A - C\right )} a^{2} b - 3 \, B a b^{2} - {\left (A - C\right )} b^{3}\right )} d^{2}\right )} \tan \left (f x + e\right )^{2} + 60 \, {\left ({\left ({\left (A - C\right )} a^{3} - 3 \, B a^{2} b - 3 \, {\left (A - C\right )} a b^{2} + B b^{3}\right )} c^{2} - 2 \, {\left (B a^{3} + 3 \, {\left (A - C\right )} a^{2} b - 3 \, B a b^{2} - {\left (A - C\right )} b^{3}\right )} c d - {\left ({\left (A - C\right )} a^{3} - 3 \, B a^{2} b - 3 \, {\left (A - C\right )} a b^{2} + B b^{3}\right )} d^{2}\right )} {\left (f x + e\right )} + 30 \, {\left ({\left (B a^{3} + 3 \, {\left (A - C\right )} a^{2} b - 3 \, B a b^{2} - {\left (A - C\right )} b^{3}\right )} c^{2} + 2 \, {\left ({\left (A - C\right )} a^{3} - 3 \, B a^{2} b - 3 \, {\left (A - C\right )} a b^{2} + B b^{3}\right )} c d - {\left (B a^{3} + 3 \, {\left (A - C\right )} a^{2} b - 3 \, B a b^{2} - {\left (A - C\right )} b^{3}\right )} d^{2}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 60 \, {\left ({\left (C a^{3} + 3 \, B a^{2} b + 3 \, {\left (A - C\right )} a b^{2} - B b^{3}\right )} c^{2} + 2 \, {\left (B a^{3} + 3 \, {\left (A - C\right )} a^{2} b - 3 \, B a b^{2} - {\left (A - C\right )} b^{3}\right )} c d + {\left ({\left (A - C\right )} a^{3} - 3 \, B a^{2} b - 3 \, {\left (A - C\right )} a b^{2} + B b^{3}\right )} d^{2}\right )} \tan \left (f x + e\right )}{60 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))^3*(c+d*tan(f*x+e))^2*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

1/60*(10*C*b^3*d^2*tan(f*x + e)^6 + 12*(2*C*b^3*c*d + (3*C*a*b^2 + B*b^3)*d^2)*tan(f*x + e)^5 + 15*(C*b^3*c^2
+ 2*(3*C*a*b^2 + B*b^3)*c*d + (3*C*a^2*b + 3*B*a*b^2 + (A - C)*b^3)*d^2)*tan(f*x + e)^4 + 20*((3*C*a*b^2 + B*b
^3)*c^2 + 2*(3*C*a^2*b + 3*B*a*b^2 + (A - C)*b^3)*c*d + (C*a^3 + 3*B*a^2*b + 3*(A - C)*a*b^2 - B*b^3)*d^2)*tan
(f*x + e)^3 + 30*((3*C*a^2*b + 3*B*a*b^2 + (A - C)*b^3)*c^2 + 2*(C*a^3 + 3*B*a^2*b + 3*(A - C)*a*b^2 - B*b^3)*
c*d + (B*a^3 + 3*(A - C)*a^2*b - 3*B*a*b^2 - (A - C)*b^3)*d^2)*tan(f*x + e)^2 + 60*(((A - C)*a^3 - 3*B*a^2*b -
 3*(A - C)*a*b^2 + B*b^3)*c^2 - 2*(B*a^3 + 3*(A - C)*a^2*b - 3*B*a*b^2 - (A - C)*b^3)*c*d - ((A - C)*a^3 - 3*B
*a^2*b - 3*(A - C)*a*b^2 + B*b^3)*d^2)*(f*x + e) + 30*((B*a^3 + 3*(A - C)*a^2*b - 3*B*a*b^2 - (A - C)*b^3)*c^2
 + 2*((A - C)*a^3 - 3*B*a^2*b - 3*(A - C)*a*b^2 + B*b^3)*c*d - (B*a^3 + 3*(A - C)*a^2*b - 3*B*a*b^2 - (A - C)*
b^3)*d^2)*log(tan(f*x + e)^2 + 1) + 60*((C*a^3 + 3*B*a^2*b + 3*(A - C)*a*b^2 - B*b^3)*c^2 + 2*(B*a^3 + 3*(A -
C)*a^2*b - 3*B*a*b^2 - (A - C)*b^3)*c*d + ((A - C)*a^3 - 3*B*a^2*b - 3*(A - C)*a*b^2 + B*b^3)*d^2)*tan(f*x + e
))/f

________________________________________________________________________________________

Fricas [A]
time = 7.55, size = 697, normalized size = 1.05 \begin {gather*} \frac {10 \, C b^{3} d^{2} \tan \left (f x + e\right )^{6} + 12 \, {\left (2 \, C b^{3} c d + {\left (3 \, C a b^{2} + B b^{3}\right )} d^{2}\right )} \tan \left (f x + e\right )^{5} + 15 \, {\left (C b^{3} c^{2} + 2 \, {\left (3 \, C a b^{2} + B b^{3}\right )} c d + {\left (3 \, C a^{2} b + 3 \, B a b^{2} + {\left (A - C\right )} b^{3}\right )} d^{2}\right )} \tan \left (f x + e\right )^{4} + 20 \, {\left ({\left (3 \, C a b^{2} + B b^{3}\right )} c^{2} + 2 \, {\left (3 \, C a^{2} b + 3 \, B a b^{2} + {\left (A - C\right )} b^{3}\right )} c d + {\left (C a^{3} + 3 \, B a^{2} b + 3 \, {\left (A - C\right )} a b^{2} - B b^{3}\right )} d^{2}\right )} \tan \left (f x + e\right )^{3} + 60 \, {\left ({\left ({\left (A - C\right )} a^{3} - 3 \, B a^{2} b - 3 \, {\left (A - C\right )} a b^{2} + B b^{3}\right )} c^{2} - 2 \, {\left (B a^{3} + 3 \, {\left (A - C\right )} a^{2} b - 3 \, B a b^{2} - {\left (A - C\right )} b^{3}\right )} c d - {\left ({\left (A - C\right )} a^{3} - 3 \, B a^{2} b - 3 \, {\left (A - C\right )} a b^{2} + B b^{3}\right )} d^{2}\right )} f x + 30 \, {\left ({\left (3 \, C a^{2} b + 3 \, B a b^{2} + {\left (A - C\right )} b^{3}\right )} c^{2} + 2 \, {\left (C a^{3} + 3 \, B a^{2} b + 3 \, {\left (A - C\right )} a b^{2} - B b^{3}\right )} c d + {\left (B a^{3} + 3 \, {\left (A - C\right )} a^{2} b - 3 \, B a b^{2} - {\left (A - C\right )} b^{3}\right )} d^{2}\right )} \tan \left (f x + e\right )^{2} - 30 \, {\left ({\left (B a^{3} + 3 \, {\left (A - C\right )} a^{2} b - 3 \, B a b^{2} - {\left (A - C\right )} b^{3}\right )} c^{2} + 2 \, {\left ({\left (A - C\right )} a^{3} - 3 \, B a^{2} b - 3 \, {\left (A - C\right )} a b^{2} + B b^{3}\right )} c d - {\left (B a^{3} + 3 \, {\left (A - C\right )} a^{2} b - 3 \, B a b^{2} - {\left (A - C\right )} b^{3}\right )} d^{2}\right )} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right ) + 60 \, {\left ({\left (C a^{3} + 3 \, B a^{2} b + 3 \, {\left (A - C\right )} a b^{2} - B b^{3}\right )} c^{2} + 2 \, {\left (B a^{3} + 3 \, {\left (A - C\right )} a^{2} b - 3 \, B a b^{2} - {\left (A - C\right )} b^{3}\right )} c d + {\left ({\left (A - C\right )} a^{3} - 3 \, B a^{2} b - 3 \, {\left (A - C\right )} a b^{2} + B b^{3}\right )} d^{2}\right )} \tan \left (f x + e\right )}{60 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))^3*(c+d*tan(f*x+e))^2*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

1/60*(10*C*b^3*d^2*tan(f*x + e)^6 + 12*(2*C*b^3*c*d + (3*C*a*b^2 + B*b^3)*d^2)*tan(f*x + e)^5 + 15*(C*b^3*c^2
+ 2*(3*C*a*b^2 + B*b^3)*c*d + (3*C*a^2*b + 3*B*a*b^2 + (A - C)*b^3)*d^2)*tan(f*x + e)^4 + 20*((3*C*a*b^2 + B*b
^3)*c^2 + 2*(3*C*a^2*b + 3*B*a*b^2 + (A - C)*b^3)*c*d + (C*a^3 + 3*B*a^2*b + 3*(A - C)*a*b^2 - B*b^3)*d^2)*tan
(f*x + e)^3 + 60*(((A - C)*a^3 - 3*B*a^2*b - 3*(A - C)*a*b^2 + B*b^3)*c^2 - 2*(B*a^3 + 3*(A - C)*a^2*b - 3*B*a
*b^2 - (A - C)*b^3)*c*d - ((A - C)*a^3 - 3*B*a^2*b - 3*(A - C)*a*b^2 + B*b^3)*d^2)*f*x + 30*((3*C*a^2*b + 3*B*
a*b^2 + (A - C)*b^3)*c^2 + 2*(C*a^3 + 3*B*a^2*b + 3*(A - C)*a*b^2 - B*b^3)*c*d + (B*a^3 + 3*(A - C)*a^2*b - 3*
B*a*b^2 - (A - C)*b^3)*d^2)*tan(f*x + e)^2 - 30*((B*a^3 + 3*(A - C)*a^2*b - 3*B*a*b^2 - (A - C)*b^3)*c^2 + 2*(
(A - C)*a^3 - 3*B*a^2*b - 3*(A - C)*a*b^2 + B*b^3)*c*d - (B*a^3 + 3*(A - C)*a^2*b - 3*B*a*b^2 - (A - C)*b^3)*d
^2)*log(1/(tan(f*x + e)^2 + 1)) + 60*((C*a^3 + 3*B*a^2*b + 3*(A - C)*a*b^2 - B*b^3)*c^2 + 2*(B*a^3 + 3*(A - C)
*a^2*b - 3*B*a*b^2 - (A - C)*b^3)*c*d + ((A - C)*a^3 - 3*B*a^2*b - 3*(A - C)*a*b^2 + B*b^3)*d^2)*tan(f*x + e))
/f

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 1819 vs. \(2 (604) = 1208\).
time = 0.50, size = 1819, normalized size = 2.75 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))**3*(c+d*tan(f*x+e))**2*(A+B*tan(f*x+e)+C*tan(f*x+e)**2),x)

[Out]

Piecewise((A*a**3*c**2*x + A*a**3*c*d*log(tan(e + f*x)**2 + 1)/f - A*a**3*d**2*x + A*a**3*d**2*tan(e + f*x)/f
+ 3*A*a**2*b*c**2*log(tan(e + f*x)**2 + 1)/(2*f) - 6*A*a**2*b*c*d*x + 6*A*a**2*b*c*d*tan(e + f*x)/f - 3*A*a**2
*b*d**2*log(tan(e + f*x)**2 + 1)/(2*f) + 3*A*a**2*b*d**2*tan(e + f*x)**2/(2*f) - 3*A*a*b**2*c**2*x + 3*A*a*b**
2*c**2*tan(e + f*x)/f - 3*A*a*b**2*c*d*log(tan(e + f*x)**2 + 1)/f + 3*A*a*b**2*c*d*tan(e + f*x)**2/f + 3*A*a*b
**2*d**2*x + A*a*b**2*d**2*tan(e + f*x)**3/f - 3*A*a*b**2*d**2*tan(e + f*x)/f - A*b**3*c**2*log(tan(e + f*x)**
2 + 1)/(2*f) + A*b**3*c**2*tan(e + f*x)**2/(2*f) + 2*A*b**3*c*d*x + 2*A*b**3*c*d*tan(e + f*x)**3/(3*f) - 2*A*b
**3*c*d*tan(e + f*x)/f + A*b**3*d**2*log(tan(e + f*x)**2 + 1)/(2*f) + A*b**3*d**2*tan(e + f*x)**4/(4*f) - A*b*
*3*d**2*tan(e + f*x)**2/(2*f) + B*a**3*c**2*log(tan(e + f*x)**2 + 1)/(2*f) - 2*B*a**3*c*d*x + 2*B*a**3*c*d*tan
(e + f*x)/f - B*a**3*d**2*log(tan(e + f*x)**2 + 1)/(2*f) + B*a**3*d**2*tan(e + f*x)**2/(2*f) - 3*B*a**2*b*c**2
*x + 3*B*a**2*b*c**2*tan(e + f*x)/f - 3*B*a**2*b*c*d*log(tan(e + f*x)**2 + 1)/f + 3*B*a**2*b*c*d*tan(e + f*x)*
*2/f + 3*B*a**2*b*d**2*x + B*a**2*b*d**2*tan(e + f*x)**3/f - 3*B*a**2*b*d**2*tan(e + f*x)/f - 3*B*a*b**2*c**2*
log(tan(e + f*x)**2 + 1)/(2*f) + 3*B*a*b**2*c**2*tan(e + f*x)**2/(2*f) + 6*B*a*b**2*c*d*x + 2*B*a*b**2*c*d*tan
(e + f*x)**3/f - 6*B*a*b**2*c*d*tan(e + f*x)/f + 3*B*a*b**2*d**2*log(tan(e + f*x)**2 + 1)/(2*f) + 3*B*a*b**2*d
**2*tan(e + f*x)**4/(4*f) - 3*B*a*b**2*d**2*tan(e + f*x)**2/(2*f) + B*b**3*c**2*x + B*b**3*c**2*tan(e + f*x)**
3/(3*f) - B*b**3*c**2*tan(e + f*x)/f + B*b**3*c*d*log(tan(e + f*x)**2 + 1)/f + B*b**3*c*d*tan(e + f*x)**4/(2*f
) - B*b**3*c*d*tan(e + f*x)**2/f - B*b**3*d**2*x + B*b**3*d**2*tan(e + f*x)**5/(5*f) - B*b**3*d**2*tan(e + f*x
)**3/(3*f) + B*b**3*d**2*tan(e + f*x)/f - C*a**3*c**2*x + C*a**3*c**2*tan(e + f*x)/f - C*a**3*c*d*log(tan(e +
f*x)**2 + 1)/f + C*a**3*c*d*tan(e + f*x)**2/f + C*a**3*d**2*x + C*a**3*d**2*tan(e + f*x)**3/(3*f) - C*a**3*d**
2*tan(e + f*x)/f - 3*C*a**2*b*c**2*log(tan(e + f*x)**2 + 1)/(2*f) + 3*C*a**2*b*c**2*tan(e + f*x)**2/(2*f) + 6*
C*a**2*b*c*d*x + 2*C*a**2*b*c*d*tan(e + f*x)**3/f - 6*C*a**2*b*c*d*tan(e + f*x)/f + 3*C*a**2*b*d**2*log(tan(e
+ f*x)**2 + 1)/(2*f) + 3*C*a**2*b*d**2*tan(e + f*x)**4/(4*f) - 3*C*a**2*b*d**2*tan(e + f*x)**2/(2*f) + 3*C*a*b
**2*c**2*x + C*a*b**2*c**2*tan(e + f*x)**3/f - 3*C*a*b**2*c**2*tan(e + f*x)/f + 3*C*a*b**2*c*d*log(tan(e + f*x
)**2 + 1)/f + 3*C*a*b**2*c*d*tan(e + f*x)**4/(2*f) - 3*C*a*b**2*c*d*tan(e + f*x)**2/f - 3*C*a*b**2*d**2*x + 3*
C*a*b**2*d**2*tan(e + f*x)**5/(5*f) - C*a*b**2*d**2*tan(e + f*x)**3/f + 3*C*a*b**2*d**2*tan(e + f*x)/f + C*b**
3*c**2*log(tan(e + f*x)**2 + 1)/(2*f) + C*b**3*c**2*tan(e + f*x)**4/(4*f) - C*b**3*c**2*tan(e + f*x)**2/(2*f)
- 2*C*b**3*c*d*x + 2*C*b**3*c*d*tan(e + f*x)**5/(5*f) - 2*C*b**3*c*d*tan(e + f*x)**3/(3*f) + 2*C*b**3*c*d*tan(
e + f*x)/f - C*b**3*d**2*log(tan(e + f*x)**2 + 1)/(2*f) + C*b**3*d**2*tan(e + f*x)**6/(6*f) - C*b**3*d**2*tan(
e + f*x)**4/(4*f) + C*b**3*d**2*tan(e + f*x)**2/(2*f), Ne(f, 0)), (x*(a + b*tan(e))**3*(c + d*tan(e))**2*(A +
B*tan(e) + C*tan(e)**2), True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 24014 vs. \(2 (660) = 1320\).
time = 18.53, size = 24014, normalized size = 36.33 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))^3*(c+d*tan(f*x+e))^2*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algorithm="giac")

[Out]

1/60*(60*A*a^3*c^2*f*x*tan(f*x)^6*tan(e)^6 - 60*C*a^3*c^2*f*x*tan(f*x)^6*tan(e)^6 - 180*B*a^2*b*c^2*f*x*tan(f*
x)^6*tan(e)^6 - 180*A*a*b^2*c^2*f*x*tan(f*x)^6*tan(e)^6 + 180*C*a*b^2*c^2*f*x*tan(f*x)^6*tan(e)^6 + 60*B*b^3*c
^2*f*x*tan(f*x)^6*tan(e)^6 - 120*B*a^3*c*d*f*x*tan(f*x)^6*tan(e)^6 - 360*A*a^2*b*c*d*f*x*tan(f*x)^6*tan(e)^6 +
 360*C*a^2*b*c*d*f*x*tan(f*x)^6*tan(e)^6 + 360*B*a*b^2*c*d*f*x*tan(f*x)^6*tan(e)^6 + 120*A*b^3*c*d*f*x*tan(f*x
)^6*tan(e)^6 - 120*C*b^3*c*d*f*x*tan(f*x)^6*tan(e)^6 - 60*A*a^3*d^2*f*x*tan(f*x)^6*tan(e)^6 + 60*C*a^3*d^2*f*x
*tan(f*x)^6*tan(e)^6 + 180*B*a^2*b*d^2*f*x*tan(f*x)^6*tan(e)^6 + 180*A*a*b^2*d^2*f*x*tan(f*x)^6*tan(e)^6 - 180
*C*a*b^2*d^2*f*x*tan(f*x)^6*tan(e)^6 - 60*B*b^3*d^2*f*x*tan(f*x)^6*tan(e)^6 - 30*B*a^3*c^2*log(4*(tan(f*x)^4*t
an(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(
f*x)^6*tan(e)^6 - 90*A*a^2*b*c^2*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(
f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^6*tan(e)^6 + 90*C*a^2*b*c^2*log(4*(tan(f*x)^4*tan(e)^
2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^6
*tan(e)^6 + 90*B*a*b^2*c^2*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2
 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^6*tan(e)^6 + 30*A*b^3*c^2*log(4*(tan(f*x)^4*tan(e)^2 - 2*ta
n(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^6*tan(e)^
6 - 30*C*b^3*c^2*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f
*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^6*tan(e)^6 - 60*A*a^3*c*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*t
an(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^6*tan(e)^6 + 60*C*a
^3*c*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e)
 + 1)/(tan(e)^2 + 1))*tan(f*x)^6*tan(e)^6 + 180*B*a^2*b*c*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) +
 tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^6*tan(e)^6 + 180*A*a*b^2*c
*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1
)/(tan(e)^2 + 1))*tan(f*x)^6*tan(e)^6 - 180*C*a*b^2*c*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan
(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^6*tan(e)^6 - 60*B*b^3*c*d*log(
4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(
e)^2 + 1))*tan(f*x)^6*tan(e)^6 + 30*B*a^3*d^2*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*ta
n(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^6*tan(e)^6 + 90*A*a^2*b*d^2*log(4*(tan(f
*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1
))*tan(f*x)^6*tan(e)^6 - 90*C*a^2*b*d^2*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2
 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^6*tan(e)^6 - 90*B*a*b^2*d^2*log(4*(tan(f*x)^4*
tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan
(f*x)^6*tan(e)^6 - 30*A*b^3*d^2*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f
*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^6*tan(e)^6 + 30*C*b^3*d^2*log(4*(tan(f*x)^4*tan(e)^2 -
 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^6*ta
n(e)^6 - 360*A*a^3*c^2*f*x*tan(f*x)^5*tan(e)^5 + 360*C*a^3*c^2*f*x*tan(f*x)^5*tan(e)^5 + 1080*B*a^2*b*c^2*f*x*
tan(f*x)^5*tan(e)^5 + 1080*A*a*b^2*c^2*f*x*tan(f*x)^5*tan(e)^5 - 1080*C*a*b^2*c^2*f*x*tan(f*x)^5*tan(e)^5 - 36
0*B*b^3*c^2*f*x*tan(f*x)^5*tan(e)^5 + 720*B*a^3*c*d*f*x*tan(f*x)^5*tan(e)^5 + 2160*A*a^2*b*c*d*f*x*tan(f*x)^5*
tan(e)^5 - 2160*C*a^2*b*c*d*f*x*tan(f*x)^5*tan(e)^5 - 2160*B*a*b^2*c*d*f*x*tan(f*x)^5*tan(e)^5 - 720*A*b^3*c*d
*f*x*tan(f*x)^5*tan(e)^5 + 720*C*b^3*c*d*f*x*tan(f*x)^5*tan(e)^5 + 360*A*a^3*d^2*f*x*tan(f*x)^5*tan(e)^5 - 360
*C*a^3*d^2*f*x*tan(f*x)^5*tan(e)^5 - 1080*B*a^2*b*d^2*f*x*tan(f*x)^5*tan(e)^5 - 1080*A*a*b^2*d^2*f*x*tan(f*x)^
5*tan(e)^5 + 1080*C*a*b^2*d^2*f*x*tan(f*x)^5*tan(e)^5 + 360*B*b^3*d^2*f*x*tan(f*x)^5*tan(e)^5 + 90*C*a^2*b*c^2
*tan(f*x)^6*tan(e)^6 + 90*B*a*b^2*c^2*tan(f*x)^6*tan(e)^6 + 30*A*b^3*c^2*tan(f*x)^6*tan(e)^6 - 45*C*b^3*c^2*ta
n(f*x)^6*tan(e)^6 + 60*C*a^3*c*d*tan(f*x)^6*tan(e)^6 + 180*B*a^2*b*c*d*tan(f*x)^6*tan(e)^6 + 180*A*a*b^2*c*d*t
an(f*x)^6*tan(e)^6 - 270*C*a*b^2*c*d*tan(f*x)^6*tan(e)^6 - 90*B*b^3*c*d*tan(f*x)^6*tan(e)^6 + 30*B*a^3*d^2*tan
(f*x)^6*tan(e)^6 + 90*A*a^2*b*d^2*tan(f*x)^6*tan(e)^6 - 135*C*a^2*b*d^2*tan(f*x)^6*tan(e)^6 - 135*B*a*b^2*d^2*
tan(f*x)^6*tan(e)^6 - 45*A*b^3*d^2*tan(f*x)^6*tan(e)^6 + 55*C*b^3*d^2*tan(f*x)^6*tan(e)^6 + 180*B*a^3*c^2*log(
4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + ...

________________________________________________________________________________________

Mupad [B]
time = 9.29, size = 891, normalized size = 1.35 \begin {gather*} x\,\left (A\,a^3\,c^2-A\,a^3\,d^2+B\,b^3\,c^2-C\,a^3\,c^2-B\,b^3\,d^2+C\,a^3\,d^2+2\,A\,b^3\,c\,d-2\,B\,a^3\,c\,d-2\,C\,b^3\,c\,d-3\,A\,a\,b^2\,c^2+3\,A\,a\,b^2\,d^2-3\,B\,a^2\,b\,c^2+3\,B\,a^2\,b\,d^2+3\,C\,a\,b^2\,c^2-3\,C\,a\,b^2\,d^2-6\,A\,a^2\,b\,c\,d+6\,B\,a\,b^2\,c\,d+6\,C\,a^2\,b\,c\,d\right )-\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (B\,b^3\,c^2-A\,a^3\,d^2-b^2\,d\,\left (B\,b\,d+3\,C\,a\,d+2\,C\,b\,c\right )-C\,a^3\,c^2+C\,a^3\,d^2+2\,A\,b^3\,c\,d-2\,B\,a^3\,c\,d-3\,A\,a\,b^2\,c^2+3\,A\,a\,b^2\,d^2-3\,B\,a^2\,b\,c^2+3\,B\,a^2\,b\,d^2+3\,C\,a\,b^2\,c^2-6\,A\,a^2\,b\,c\,d+6\,B\,a\,b^2\,c\,d+6\,C\,a^2\,b\,c\,d\right )}{f}-\frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )\,\left (\frac {A\,b^3\,c^2}{2}-\frac {B\,a^3\,c^2}{2}-\frac {A\,b^3\,d^2}{2}+\frac {B\,a^3\,d^2}{2}-\frac {C\,b^3\,c^2}{2}+\frac {C\,b^3\,d^2}{2}-A\,a^3\,c\,d-B\,b^3\,c\,d+C\,a^3\,c\,d-\frac {3\,A\,a^2\,b\,c^2}{2}+\frac {3\,A\,a^2\,b\,d^2}{2}+\frac {3\,B\,a\,b^2\,c^2}{2}-\frac {3\,B\,a\,b^2\,d^2}{2}+\frac {3\,C\,a^2\,b\,c^2}{2}-\frac {3\,C\,a^2\,b\,d^2}{2}+3\,A\,a\,b^2\,c\,d+3\,B\,a^2\,b\,c\,d-3\,C\,a\,b^2\,c\,d\right )}{f}+\frac {{\mathrm {tan}\left (e+f\,x\right )}^4\,\left (\frac {A\,b^3\,d^2}{4}+\frac {C\,b^3\,c^2}{4}-\frac {C\,b^3\,d^2}{4}+\frac {B\,b^3\,c\,d}{2}+\frac {3\,B\,a\,b^2\,d^2}{4}+\frac {3\,C\,a^2\,b\,d^2}{4}+\frac {3\,C\,a\,b^2\,c\,d}{2}\right )}{f}+\frac {{\mathrm {tan}\left (e+f\,x\right )}^3\,\left (\frac {B\,b^3\,c^2}{3}-\frac {b^2\,d\,\left (B\,b\,d+3\,C\,a\,d+2\,C\,b\,c\right )}{3}+\frac {C\,a^3\,d^2}{3}+\frac {2\,A\,b^3\,c\,d}{3}+A\,a\,b^2\,d^2+B\,a^2\,b\,d^2+C\,a\,b^2\,c^2+2\,B\,a\,b^2\,c\,d+2\,C\,a^2\,b\,c\,d\right )}{f}+\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {A\,b^3\,c^2}{2}-\frac {A\,b^3\,d^2}{2}+\frac {B\,a^3\,d^2}{2}-\frac {C\,b^3\,c^2}{2}+\frac {C\,b^3\,d^2}{2}-B\,b^3\,c\,d+C\,a^3\,c\,d+\frac {3\,A\,a^2\,b\,d^2}{2}+\frac {3\,B\,a\,b^2\,c^2}{2}-\frac {3\,B\,a\,b^2\,d^2}{2}+\frac {3\,C\,a^2\,b\,c^2}{2}-\frac {3\,C\,a^2\,b\,d^2}{2}+3\,A\,a\,b^2\,c\,d+3\,B\,a^2\,b\,c\,d-3\,C\,a\,b^2\,c\,d\right )}{f}+\frac {b^2\,d\,{\mathrm {tan}\left (e+f\,x\right )}^5\,\left (B\,b\,d+3\,C\,a\,d+2\,C\,b\,c\right )}{5\,f}+\frac {C\,b^3\,d^2\,{\mathrm {tan}\left (e+f\,x\right )}^6}{6\,f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*tan(e + f*x))^3*(c + d*tan(e + f*x))^2*(A + B*tan(e + f*x) + C*tan(e + f*x)^2),x)

[Out]

x*(A*a^3*c^2 - A*a^3*d^2 + B*b^3*c^2 - C*a^3*c^2 - B*b^3*d^2 + C*a^3*d^2 + 2*A*b^3*c*d - 2*B*a^3*c*d - 2*C*b^3
*c*d - 3*A*a*b^2*c^2 + 3*A*a*b^2*d^2 - 3*B*a^2*b*c^2 + 3*B*a^2*b*d^2 + 3*C*a*b^2*c^2 - 3*C*a*b^2*d^2 - 6*A*a^2
*b*c*d + 6*B*a*b^2*c*d + 6*C*a^2*b*c*d) - (tan(e + f*x)*(B*b^3*c^2 - A*a^3*d^2 - b^2*d*(B*b*d + 3*C*a*d + 2*C*
b*c) - C*a^3*c^2 + C*a^3*d^2 + 2*A*b^3*c*d - 2*B*a^3*c*d - 3*A*a*b^2*c^2 + 3*A*a*b^2*d^2 - 3*B*a^2*b*c^2 + 3*B
*a^2*b*d^2 + 3*C*a*b^2*c^2 - 6*A*a^2*b*c*d + 6*B*a*b^2*c*d + 6*C*a^2*b*c*d))/f - (log(tan(e + f*x)^2 + 1)*((A*
b^3*c^2)/2 - (B*a^3*c^2)/2 - (A*b^3*d^2)/2 + (B*a^3*d^2)/2 - (C*b^3*c^2)/2 + (C*b^3*d^2)/2 - A*a^3*c*d - B*b^3
*c*d + C*a^3*c*d - (3*A*a^2*b*c^2)/2 + (3*A*a^2*b*d^2)/2 + (3*B*a*b^2*c^2)/2 - (3*B*a*b^2*d^2)/2 + (3*C*a^2*b*
c^2)/2 - (3*C*a^2*b*d^2)/2 + 3*A*a*b^2*c*d + 3*B*a^2*b*c*d - 3*C*a*b^2*c*d))/f + (tan(e + f*x)^4*((A*b^3*d^2)/
4 + (C*b^3*c^2)/4 - (C*b^3*d^2)/4 + (B*b^3*c*d)/2 + (3*B*a*b^2*d^2)/4 + (3*C*a^2*b*d^2)/4 + (3*C*a*b^2*c*d)/2)
)/f + (tan(e + f*x)^3*((B*b^3*c^2)/3 - (b^2*d*(B*b*d + 3*C*a*d + 2*C*b*c))/3 + (C*a^3*d^2)/3 + (2*A*b^3*c*d)/3
 + A*a*b^2*d^2 + B*a^2*b*d^2 + C*a*b^2*c^2 + 2*B*a*b^2*c*d + 2*C*a^2*b*c*d))/f + (tan(e + f*x)^2*((A*b^3*c^2)/
2 - (A*b^3*d^2)/2 + (B*a^3*d^2)/2 - (C*b^3*c^2)/2 + (C*b^3*d^2)/2 - B*b^3*c*d + C*a^3*c*d + (3*A*a^2*b*d^2)/2
+ (3*B*a*b^2*c^2)/2 - (3*B*a*b^2*d^2)/2 + (3*C*a^2*b*c^2)/2 - (3*C*a^2*b*d^2)/2 + 3*A*a*b^2*c*d + 3*B*a^2*b*c*
d - 3*C*a*b^2*c*d))/f + (b^2*d*tan(e + f*x)^5*(B*b*d + 3*C*a*d + 2*C*b*c))/(5*f) + (C*b^3*d^2*tan(e + f*x)^6)/
(6*f)

________________________________________________________________________________________